<html xmlns:th="http://www.thymeleaf.org">
<link type="text/css" href="/topjui/css/myui.css" rel="stylesheet"/>
<form id="customerform" method="post" style="padding-top:1px">
<input type="hidden" id="id" name="id" value="0">
<table class="editTable">
    <tr>
        <td class="label">配电房名称</td>
        <td>
            <input type="text" name="boardname" autocomplete="off"  class="selectp" data-options="required:true" style="width:350px;">
        </td>
    </tr>
    <tr>
        <td class="label">用户电压登记</td>
        <td>
            <input type="text" name="voltmark" autocomplete="off"  class="selectp" data-options="required:true" style="width:350px;">
        </td>
    </tr>
    <tr>
        <td class="label">容量</td>
        <td>
            <input type="text" name="volume" autocomplete="off"  class="selectp" data-options="required:true" style="width:350px;">
        </td>
    </tr>
    <tr>
        <td class="label">用户类型</td>
        <td>
            <input type="text" name="usertype" autocomplete="off"  class="selectp" data-options="required:true" style="width:350px;">
        </td>
    </tr>
    <tr>
        <td class="label">配电房单位名称</td>
        <td>
            <input type="text" name="factoryname" autocomplete="off"  class="selectp" data-options="required:true" style="width:350px;">
        </td>
    </tr>
    <tr>
        <td class="label">配电房单位负责人</td>
        <td>
            <input type="text" name="factoryuser" autocomplete="off"  class="selectp" data-options="required:true" style="width:350px;">
        </td>
    </tr>
    <tr>
        <td class="label">配电房单位联系方式</td>
        <td>
            <input type="text" name="factoryphone" autocomplete="off"  class="selectp" data-options="required:true" style="width:350px;">
        </td>
    </tr>
    <tr>
        <td class="label">定时巡检日期</td>
        <td>
            <input id="form-checktime" type="text" name="checktime"  class="selectp" data-options="required:true" style="width:350px;">
        </td>
    </tr>
    <tr>
        <td class="label">所属巡视单位</td>
        <td>
            <input type="hidden" class="easyui-validatebox" data-options="required:true" id="form-routerid" name="routerid" value="0" >
            <input class="selectp"  type="text" name="routername" id="form-routername" style="width: 350px;">
        </td>
    </tr>
    <tr>
        <td class="label">所属项目</td>
        <td>
            <input type="hidden" id="projectcode" name="projectcode">
            <input type="hidden" class="easyui-validatebox"  name="projectid" value="0" >
            <input class="selectp"  type="text" name="projectname" id="form-projectname" style="width: 350px;">
        </td>
    </tr>
    <tr>
        <td class="label">状态</td>
        <td>
            <select name="status" style="width: 378px;" class="selectp">
                <option value="1">正常</option>
                <option value='0'>禁用</option>
            </select>
        </td>
    </tr>
</table>
</form>
<script th:inline="javascript">
    $(function () {
        $('#form-routername').combobox({
            width: 350,
            height: 32,
            valueField: 'id',
            textField: 'name',
            style: "width:350px;height:32px;",
            cls: 'selectp',
            panelWidth: 350,
            hasDownArrow: true,
            url: '/router/all',
            required: true,
            onSelect: function (data) {
                $("#form-routerid").val(data.id);
                $("input[name='routername']").val(data.name);

            }
        });
        $(".combo-text").removeAttr("style");
        $(".combo-text").attr("style", "width:350px;height:32px;line-height:32px");
        $(".combo-text").addClass("selectp");
        $(".combo-arrow").attr("style", "margin-left: -20px;margin-top: 8px;background-color:rgba(0,0,0,0)");
        $(".combo-panel").attr("style", "margin-top:10px;");

        $('#form-projectname').combobox({
            width: 390,
            height: 32,
            valueField: 'id',
            textField: 'projectname',
            style: "width:390px;height:32px;",
            cls: 'selectp',
            panelWidth: 390,
            hasDownArrow: true,
            url: '/project/all',
            required: true,
            onSelect: function (data) {
                $("#form-routerid").val(data.id);
                $("input[name='projectid']").val(data.id);
                $("input[name='projectname']").val(data.projectname);
                $("input[name='projectcode']").val(data.projectcode);
            }
        });
        $(".combo-text").removeAttr("style");
        $(".combo-text").attr("style", "width:390px;height:32px;line-height:32px");
        $(".combo-text").addClass("selectp");
        $(".combo-arrow").attr("style", "margin-left: -20px;margin-top: 8px;background-color:rgba(0,0,0,0)");
        $(".combo-panel").attr("style", "margin-top:10px;");

        //日期样式
        $('#form-checktime').datebox({
            required: true,
            formatter: function (date) {

                var y = date.getFullYear();
                var m = date.getMonth() + 1;
                var d = date.getDate();
                return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);

            }
        });
        $(".combo-text").removeAttr("style");
        $(".combo-text").attr("style", "width:350px;height:32px;line-height:32px");
        $(".combo-text").addClass("selectp");
        $(".combo-arrow").attr("style", "margin-left: -20px;margin-top: 8px;background-color:rgba(0,0,0,0)");
        $(".combo-panel").attr("style", "margin-top:10px;");
    });


</script>
</html>